CC = gcc  
  
SRC = main.c  
  
MODULEA_OBJ = BUILD/student.o  
MODULEB_OBJ = BUILD/course.o  
LOG_OBJ = BUILD/log.o
  

TARGET=main
all: clean install_module $(TARGET)  

$(TARGET):$(SRC) $(MODULEA_OBJ) $(MODULEB_OBJ) $(LOG_OBJ)
	$(CC) $(SRC) $(MODULEA_OBJ) $(MODULEB_OBJ) $(LOG_OBJ) -o $(TARGET)

  
clean:  
	rm -f $(TARGET)  
	cd ModuleA && make clean  
	cd ModuleB && make clean  
	cd log && make clean  
  
install_module:  
	cd log && make
	cd ModuleA && make  
	cd ModuleB && make  